package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user/shop")
@RestController("userShopController")
@Slf4j
public class ShopController {
    ///admin/shop/{status}
    @Autowired
    private RedisTemplate redisTemplate;
    @PutMapping("/status")
    @ApiOperation("得到营业状态")
    public Result<Integer> getStatus(){
        Integer integer = (Integer)redisTemplate.opsForValue().get("SHOP_STATUS");
        log.info("设置营业状态为：{}",integer);
        return Result.success(integer);
    }


}
